import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
import _createClass from "@babel/runtime/helpers/esm/createClass";
import _inherits from "@babel/runtime/helpers/esm/inherits";
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
import _applyDecoratedDescriptor from "@babel/runtime/helpers/esm/applyDecoratedDescriptor";

var _dec, _dec2, _dec3, _class, _class2;

import React from 'react';
import { Form, Button, Input, Row, Col } from 'antd';
import { Bind } from 'lodash-decorators';
import intl from 'utils/intl';
import { SEARCH_FORM_ROW_LAYOUT, FORM_COL_2_LAYOUT, SEARCH_FORM_ITEM_LAYOUT } from 'utils/constants';
var QueryForm = (_dec = Form.create({
  fieldNameProp: null
}), _dec2 = Bind(), _dec3 = Bind(), _dec(_class = (_class2 = /*#__PURE__*/function (_React$Component) {
  _inherits(QueryForm, _React$Component);

  var _super = _createSuper(QueryForm);

  function QueryForm() {
    _classCallCheck(this, QueryForm);

    return _super.apply(this, arguments);
  }

  _createClass(QueryForm, [{
    key: "handleResetBtnClick",
    value:
    /**
     * 重置查询表单
     * @param {*} e
     */
    function handleResetBtnClick(e) {
      e.preventDefault();
      var form = this.props.form;
      form.resetFields();
    }
    /**
     * 查询表单-查询
     * @param {*} e
     */

  }, {
    key: "handleSearchBtnClick",
    value: function handleSearchBtnClick(e) {
      e.preventDefault();
      var onSearch = this.props.onSearch;
      onSearch();
    }
  }, {
    key: "render",
    value: function render() {
      var form = this.props.form;
      return /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(Row, Object.assign({
        type: "flex",
        align: "bottom",
        gutter: 24
      }, SEARCH_FORM_ROW_LAYOUT), /*#__PURE__*/React.createElement(Col, FORM_COL_2_LAYOUT, /*#__PURE__*/React.createElement(Form.Item, Object.assign({}, SEARCH_FORM_ITEM_LAYOUT, {
        label: intl.get('ciam.roleManagement.model.roleManagement.clientName').d('客户端名称')
      }), form.getFieldDecorator('name')( /*#__PURE__*/React.createElement(Input, null)))), /*#__PURE__*/React.createElement(Col, FORM_COL_2_LAYOUT, /*#__PURE__*/React.createElement(Form.Item, SEARCH_FORM_ITEM_LAYOUT, /*#__PURE__*/React.createElement(Button, {
        onClick: this.handleResetBtnClick,
        style: {
          marginRight: '8px'
        }
      }, intl.get('cpaas.common.button.reset').d('重置')), /*#__PURE__*/React.createElement(Button, {
        htmlType: "submit",
        type: "primary",
        onClick: this.handleSearchBtnClick
      }, intl.get('cpaas.common.button.search').d('查询'))))));
    }
  }]);

  return QueryForm;
}(React.Component), (_applyDecoratedDescriptor(_class2.prototype, "handleResetBtnClick", [_dec2], Object.getOwnPropertyDescriptor(_class2.prototype, "handleResetBtnClick"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, "handleSearchBtnClick", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, "handleSearchBtnClick"), _class2.prototype)), _class2)) || _class);
export { QueryForm as default };